package src

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
)

type userinfo struct {
	Name string
	Collage string
	Subject string
	Tel string
	Grate string
	Interest string
	Introduce string
	Sex string
}

func GetForm(c *gin.Context){
	var info userinfo
	info.Collage = c.Query("collage");
	info.Grate = c.Query("grate");
	info.Interest = c.Query("interest");
	info.Name = c.Query("name");
	info.Introduce = c.Query("introduce");
	info.Subject = c.Query("subject");
	info.Tel = c.Query("tel");
	info.Sex = c.Query("sex")
	id := CreateCaptcha()
	_,err := Db.Exec("INSERT INTO memberinfo(id,college,grate,interest,name,introduce,subject,tel,sex) VALUES (?,?,?,?,?,?,?,?,?)",id,info.Collage,info.Grate,info.Interest,info.Name,info.Introduce,info.Subject,info.Tel,info.Sex);
	fmt.Println(info)
	c.JSONP(http.StatusOK,gin.H{
		"errorMessage":err,
	})
}
